Code sequence generator

ABSTRACT

A code sequence generator ( 20 ) comprising a memory ( 22 ), a feedback logic network ( 24 ) and an output logic network ( 26 ) which is configured to perform a logic function on the contents of elements ( 26 ) of the memory ( 22 ) to generate bits of the code sequence, wherein the code sequence generator ( 20 ) outputs a plurality of bits of the code simultaneously.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a code sequence generator and to amethod of generating a code sequence.

2. Description of Related Art

In third generation (3G) and other telecommunications systems, it iscommonplace for a transmitted signal to be “spread” across a widefrequency range to improve the signal to noise plus interference ratioof the transmitted signal. As part of this spreading process, apseudo-random bit sequence known as a scrambling code may be applied tothe signal to be transmitted. One approach to generating the scramblingcode to be applied to the signal to be transmitted is to use a linearfeedback shift register (LFSR). An LFSR is shown generally at 10 in FIG.1, and comprises a shift register 12 which is pre-loaded with an initialbit sequence (known as a seed), a feedback logic network 14 and anoutput logic network 16.

The feedback logic network 14 is typically a network of one or moreexclusive-or logic gates whose inputs are connected to particularelements of the shift register 12. The feedback logic network 14generates a new input bit, which is input to the shift register 12 atthe most significant bit (MSB) position. The output logic network 16 istypically a network of exclusive-or gates whose inputs are connected toparticular elements of the shift register 12.

The LFSR 10 is clocked, such that each clock cycle the contents of theshift register 12 are shifted to the right by one position. The feedbacklogic network 14 causes a new bit value to be input to the MSB positionof the shift register 12 each clock cycle, and this changes the contentsof the shift register 12. The output logic network 16 generates anoutput bit each clock cycle, which output bit is dependent upon thecontents of the elements of the shift register 12 to which the inputs ofthe output logic network cycle are connected. In this way, apseudo-random bit sequence is output by the LFSR 10 over the course of anumber of clock cycles.

A disadvantage of the LFSR illustrated in FIG. 1 is that only one bit ofthe output bit sequence (i.e. the code generated) is produced each clockcycle, and thus it may take a considerable amount of time to generate ascrambling code, which in turn delays “downstream” operations.

BRIEF SUMMARY OF THE INVENTION

According to a first aspect of the present invention, there is provideda code sequence generator comprising a memory, a feedback logic networkand an output logic network which is configured to perform a logicfunction on the contents of elements of the memory to generate bits ofthe code sequence, wherein the code sequence generator outputs aplurality of bits of the code sequence simultaneously.

Outputting a plurality of bits of the code sequence simultaneouslyenables parallel processing of the code sequence by components of asystem which uses the code sequence, thus improving the performance ofsuch a system.

The feedback logic network may be configured to perform a logic functionon the contents of elements of the memory to generate new input bits tothe memory.

The output logic network may implement a plurality of output bit maskswhich define how the output bits of the code generator are generated.

A first of the plurality of the output bit masks may predefined and theremainder of the plurality of the output bit masks may be derived fromthe first of the plurality of the output bit masks.

The feedback logic network may implement a plurality of bit masks whichdefine how the new input bits are generated.

A first of the plurality of feedback bit masks may be predefined and theremainder of the plurality of feedback bit masks may be derived from thefirst of the plurality of the feedback bit masks.

Where a most significant bit of an nth output bit mask of the pluralityof the output bit masks is set to logic 1, the (n+1)th output bit maskmay derived from the nth output bit mask and a feedback bit mask.

Where a most significant bit of an nth feedback bit mask of theplurality of feedback bit masks is set to logic 1, an (n+1)th feedbackbit mask may be derived from the nth feedback bit mask and another ofthe plurality of feedback bit masks.

According to a second aspect of the invention, there is provided amethod of generating a code sequence, the method comprising populating amemory with a sequence of bits, performing a feedback logic operation onbits of the sequence in the memory unit, performing an output logicoperation on bits of the sequence in the memory and simultaneouslyoutputting a plurality of bits of the code sequence so generated.

Performing a feedback logic operation may comprise performing a logicfunction on the contents of elements of the memory to generate new inputbits to the memory.

Performing an output logic operation may comprise implementing aplurality of output bit masks which define how the plurality of bits ofthe code sequence outputted are generated.

A first of the plurality of the output bit masks may be predefined andthe remainder of the plurality of the output bit masks may be derivedfrom the first of the plurality of the output bit masks.

Performing a feedback logic operation may comprise implementing aplurality of bit masks which define how the new input bits aregenerated.

A first of the plurality of feedback bit masks may be predefined and theremainder of the plurality of feedback bit masks may be derived from thefirst of the plurality of the feedback bit masks.

Where a most significant bit of an nth output bit mask of the pluralityof the output bit masks is set to logic 1, the (n+1)th output bit maskmay be derived from the nth output bit mask and a feedback bit mask.

Where a most significant bit of an nth feedback bit mask of theplurality of feedback bit masks is set to logic 1, an (n+1)th feedbackbit mask may be derived from the nth feedback bit mask and another ofthe plurality of feedback bit masks.

According to a third aspect of the invention, there is provided acomputer program for performing the method of the second aspect.

BRIEF DESCRIPTION OF THE DRAWINGS

Embodiments of the invention will now be described, strictly by way ofexample only, with reference to the accompanying drawings, of which

FIG. 1 is a schematic illustration of a known linear feedback shiftregister;

FIG. 2 is a schematic illustration of a code generator according to thepresent invention which is capable of outputting two bitssimultaneously; and

FIG. 3 is a schematic illustration showing exemplary feedback and outputlogic networks for a code generator according to the present inventionwhich is capable of outputting four bits simultaneously.

DETAILED DESCRIPTION OF THE INVENTION

Referring first to FIG. 2, a code generator is shown generally at 20.The code generator 20 comprises a memory unit, in this example a shiftregister 22, having eighteen elements 28 (numbered 0 to 17 in the Figureto indicate the bit position in the shift register 22 of each element),each of which is capable of storing a single bit. Thus, the codegenerator 20 produces a code sequence comprising eighteen bits. Theshift register 22 is pre-loaded with an eighteen-bit seed, which forms astarting value from which a code sequence may be generated. The codegenerator 20 is synchronised to a clock signal (not shown) whichcontrols the timing of actions carried out by the code generator 20.

A feedback logic network 24 is connected to the shift register 22 toimplement feedback bit masks which determine how new input bits to theshift register 22 are generated. The feedback logic network 24 comprisesone or more logic gates such as exclusive-or gates, whose inputs areconnected, directly or indirectly, to elements 28 of the shift register22, with a first output 30 of the feedback logic network 24 beingconnected to a first element 32 (i.e. bit 17) of the shift register 22and a second output 34 of the feedback logic network 24 being connectedto a second element 36 (bit 16) of the shift register 22. The outputs30, 34 of the feedback logic network are dependent upon the contents ofthe elements 28 of the shift register 22 to which the inputs of thelogic gates of the feedback logic network 24 are connected.

An output logic network 26 is connected to the shift register 22 toimplement output bit masks which determine how output bits from the codegenerator 20 are generated. The output logic network 26 comprises one ormore logic gates such as exclusive-or gates, whose inputs are connected,directly or indirectly, to elements 28 of the shift register 22. Theoutput logic network 26 of this example has two outputs 38, 40, and thusthe code generator 20 is able to output two bits of a generated codesequence simultaneously.

Every clock cycle the contents of the shift register 22 are shifted tothe right by two bit positions. For example, the bits contained inelements 32 and 36 are shifted to elements 42 and 44 respectively.Elements 32 and 36 are filled with new input bits generated by thefeedback logic network 24, and these new input bits are based on thecontents of the shift register 22 in the previous clock cycle. As thecontents of the shift register 22 change every clock cycle, two newoutput bits are generated by the output logic network 26 every clockcycle, and these output bits are dependent upon the contents of theelements 28 of the shift register 22 to which the inputs of the logicgates of the output logic network 26 are connected. Thus, the codegenerator 20 illustrated in FIG. 2 produces two bits of a code sequencesimultaneously every clock cycle, which permits faster processing of thegenerated code sequence by downstream components of a system such as atransmitter or receiver in which the code generator is used.

FIG. 3 illustrates an example of a code generator which is able tooutput four bits of a generated code sequence simultaneously. The codegenerator, illustrated generally at 50, comprises an eighteen bit memoryunit in the form of a shift register 52 (whose elements are labelled 0to 17 in the Figure to indicate the bit positions in the shift register52 of the elements) to which are connected a feedback logic network 54and an output logic network 56. The code generator 50 is synchronised toa clock signal (not shown). The shift register 52 is pre-loaded with an18 bit seed from which code sequences may be generated.

The feedback logic network 56 implements four feedback bit masks 58, 60,62, 64 which determine how new inputs to the shift register 52 aregenerated. The feedback bit masks are defined in the table below, whichlists the shift register bit positions used by the feedback bit masks58, 60, 62, 64.

17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 58 0 0 0 0 0 0 0 0 0 0 1 0 00 0 0 0 1 60 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 62 0 0 0 0 0 0 0 0 1 00 0 0 0 0 1 0 0 64 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0

Thus, to implement feedback bit mask 58, the elements of the shiftregister 52 at bit positions 0 and 7 are connected to the inputs of anexclusive-or gate 66, whose output is connected to the fourth element ofthe shift register 52, which corresponds to bit position 14.

Similarly, to implement feedback bit mask 60, the elements of the shiftregister 52 corresponding to bit positions 1 and 8 are connected to theinputs of an exclusive-or gate 68, whose output is connected to thethird element of the shift register 52, which corresponds to bitposition 15.

Feedback bit mask 62 is implemented by connecting the inputs of anexclusive-or gate 70 to the elements of the shift register 52corresponding to bit positions 2 and 9, with the output of theexclusive-or gate 70 being connected to the second element of the shiftregister 52, which corresponds to bit position 16, whilst feedback bitmask 64 is implemented by connecting the inputs of an exclusive-or gate72 to the elements of the shift register 52 corresponding to bitpositions 3 and 10, with the output of the exclusive-or gate 72 beingconnected to the first element of the shift register, which correspondsto bit position 17.

The output logic network 56 implements four output bit masks 74, 76, 78,80 which determine how outputs Q0, Q1, Q2 and Q3 of the code generator50 are generated. The output bit masks are defined in the table below,which lists the shift register bit positions used by the output bitmasks 74, 76, 78, 80.

17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 74 0 0 1 0 0 0 0 0 0 0 0 1 01 0 0 0 0 76 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 78 1 0 0 0 0 0 0 0 0 10 1 0 0 0 0 0 0 80 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1

Thus, to implement output bit mask 74, the elements of the shiftregister 52 at bit positions 4, 6 and 15 are connected to the inputs ofan exclusive-or gate 82, whose output forms output bit Q0 of the codegenerator 50.

Similarly, the output bit mask 76, which determines how the output bitQ1 of the code generator 50 is generated, is implemented using a singleexclusive-or gate 84 whose inputs are connected to the elements of theshift register 52 at bit positions 5, 7 and 16.

To implement output bit mask 78, the elements of the shift register 52at bit positions 6, 8 and 17 are connected to the inputs of anexclusive-or gate 86, whose output is used as the output Q2 of the codegenerator 50.

Output bit mask 80 is implemented using a single two-input exclusive-orgate 88 whose inputs are connected to the elements of the shift register52 corresponding to bit positions 0 and 9. The output of theexclusive-or gate 88 is used as output Q3 of the code generator.

Every clock cycle, the contents of the shift register 52 are shifted tothe right by four bit positions. The contents of the shift registerelements at bit positions 17, 16, 15 and 14 are replaced by bitsgenerated by the feedback logic network 54 in accordance with thefeedback bit masks 58, 60, 62, 64. The inputs to the output logicnetwork 56 change as the contents of the elements of the shift register52 change, and thus the output bits Q0 to Q3 change in accordance withthe output bit masks 74, 76, 78, 80. In this way the code generator 50is able to output four bits of the code sequence simultaneously in asingle clock cycle, which permits faster processing of the codegenerated by downstream components of a system such as a transmitter orreceiver in which the code generator is used.

The feedback bit masks 58, 60, 62, 64 and the output bit masks 74, 76,78, 80 are defined according to the type of code sequence to begenerated by the code generator 50. It will be noted that in thisexample the feedback bit mask 60 is a copy of the feedback bit mask 58which has been shifted to the left by one bit position. Similarly, thefeedback bit mask 64 is a copy of the feedback bit mask 62 which hasbeen shifted to the left by one position.

As a general rule, the feedback bit mask Fn+i which defines the input toa shift register element at bit position n+i can be derived from afeedback bit mask defining the input to shift register element at aposition n, to the right of the position n+i, as follows:F _(n+i) =F _(n) <<i,where << indicates a bitwise shift to the left.

The output bit masks 78, 76 are similarly bit-shifted versions of theoutput bit mask 74, and the general rules described above in relation tothe feedback bit masks apply to the output bit masks. Thus,O _(n+i) =O _(n) <<i,where O_(n) is the output bit mask which defines an nth output of theoutput logic network.

However, in the case where the most significant bit (MSB) of an outputbit mask is set to 1, as is the case for output bit mask 78, the nextoutput bit mask is calculated by performing a bitwise shift to the leftof the current output bit mask and performing a bitwise exclusive-oroperation on the shifted bit mask with the first feedback bit mask 58.

Output bit mask 78 is as follows

17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 78 1 0 0 0 0 0 0 0 0 1 0 1 00 0 0 0 0

To calculate output bit mask 80 it is necessary first to shift outputbit mask 78 to the left by one bit position, giving

17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 00 0 0 0

The result of this shifting operation is then subjected to anexclusive-or operation with the first feedback bit mask 58, to give thefourth output bit mask 80.

17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 80 0 0 0 0 0 0 0 0 1 0 0 0 00 0 0 0 1To generalise,if MSB(O _(n))=1,O _(n+1)=(O _(n)<<1)⊕F ₀,where F₀ is the first feedback bit mask.

In the case where it is desired to generate a feedback bit mask from thecurrent feedback bit mask, in which the most significant bit is set tologic 1, the same process is followed, i.e. the current feedback bitmask is shifted to the left by one bit position and the result issubjected to an exclusive-or operation with the first feedback bit mask.Thus in general,if MSB(F _(n))=1,F _(n+1)=(F _(n)<<1)⊕F ₀

In the examples presented above, exclusive-or gates are used in thefeedback and output logic networks. However, it will be appreciated thatother logic gates or combinations of logic gates may also be used,depending upon the type of code sequence required.

The exemplary code generators 20, 50 described above are implementedusing standard hardware elements. However, it will be appreciated thatthe code generators could equally be implemented in software running onan appropriately configured processing system.

Although a few preferred embodiments of the present invention have beendescribed, it will be understood by those skilled in the art that thepresent invention should not be limited to the described preferredembodiments, but various changes and modifications can be made withinthe spirit and scope of the present invention as defined by the appendedclaims.

1. A code sequence generator comprising a memory, a feedback logicnetwork and an output logic network which is configured to perform alogic function on the contents of elements of the memory to generatebits of the code sequence, the code sequence generator being configuredto output a plurality of bits of the code sequence simultaneously,wherein the output logic network implements a plurality of output bitmasks which define how the output bits of the code generator aregenerated, and wherein a most significant bit of an nth output bit maskof the plurality of the output bit masks is set to logic 1 and the(n+1)th output bit mask is derived from the nth output bit mask and afeedback bit mask.
 2. A code sequence generator according to claim 1wherein the feedback logic network is configured to perform a logicfunction on the contents of elements of the memory to generate new inputbits to the memory unit.
 3. A code sequence generator according to claim1 wherein a first of the plurality of the output bit masks is predefinedand the remainder of the plurality of the output bit masks are derivedfrom the first of the plurality of the output bit masks.
 4. A codesequence generator according to claim 2 wherein the feedback logicnetwork implements a plurality of bit masks which define how the newinput bits are generated.
 5. A code sequence generator according toclaim 4 wherein a first of the plurality of feedback bit masks ispredefined and the remainder of the plurality of feedback bit masks arederived from the first of the plurality of the feedback bit masks.
 6. Acode sequence generator according to claim 4 wherein a most significantbit of an nth feedback bit mask of the plurality of feedback bit masksis set to logic 1 and an (n+1)th feedback bit mask is derived from thenth feedback bit mask and another of the plurality of feedback bitmasks.
 7. A method of generating a code sequence, the method comprisingpopulating a memory with a sequence of bits, performing a feedback logicoperation on bits of the sequence in the memory, performing an outputlogic operation on bits of the sequence in the memory and simultaneouslyoutputting a plurality of bits of the code sequence so generated,wherein performing an output logic operation comprises implementing aplurality of output bit masks which define how the plurality of bits ofthe code sequence outputted are generated, and wherein a mostsignificant bit of an nth output bit mask of the plurality of the outputbit masks is set to logic 1 and the (n+1)th output bit mask is derivedfrom the nth output bit mask and a feedback bit mask.
 8. A methodaccording to claim 7 wherein performing a feedback logic operationcomprises performing a logic function on the contents of elements of thememory to generate new input bits to the memory.
 9. A method accordingto claim 7 wherein a first of the plurality of the output bit masks ispredefined and the remainder of the plurality of the output bit masksare derived from the first of the plurality of the output bit masks. 10.A method according to claim 8 wherein performing a feedback logicoperation comprises implementing a plurality of bit masks which definehow the new input bits are generated.
 11. A method according to claim 10wherein a first of the plurality of feedback bit masks is predefined andthe remainder of the plurality of feedback bit masks are derived fromthe first of the plurality of the feedback bit masks.
 12. A methodaccording to claim 10 wherein a most significant bit of an nth feedbackbit mask of the plurality of feedback bit masks is set to logic 1 and an(n+1)th feedback bit mask is derived from the nth feedback bit mask andanother of the plurality of feedback bit masks.
 13. A non-transitorycomputer-readable medium containing non-transitory instructions forgenerating a code sequence according to a method comprising: populatinga memory with a sequence of bits; performing a feedback logic operationon bits of the sequence in the memory; performing an output logicoperation on bits of the sequence in the memory; and simultaneouslyoutputting a plurality of bits of the code sequence so generated,wherein performing an output logic operation comprises implementing aplurality of output bit masks which define how the plurality of bits ofthe code sequence outputted are generated, and wherein a mostsignificant bit of an nth output bit mask of the plurality of the outputbit masks is set to logic 1 and the (n+1)th output bit mask is derivedfrom the nth output bit mask and a feedback bit mask.
 14. A codesequence generator comprising a memory, a feedback logic network and anoutput logic network which is configured to perform a logic function onthe contents of elements of the memory to generate bits of the codesequence, the code sequence generator being configured to output aplurality of bits of the code sequence simultaneously, wherein thefeedback logic network implements a plurality of bit masks which definehow the new input bits are generated, and wherein a most significant bitof an nth feedback bit mask of the plurality of feedback bit masks isset to logic 1 and an (n+1)th feedback bit mask is derived from the nthfeedback bit mask and another of the plurality of feedback bit masks.15. A method of generating a code sequence, the method comprisingpopulating a memory with a sequence of bits, performing a feedback logicoperation on bits of the sequence in the memory, performing an outputlogic operation on bits of the sequence in the memory and simultaneouslyoutputting a plurality of bits of the code sequence so generated,wherein performing a feedback logic operation comprises implementing aplurality of bit masks which define how the new input bits aregenerated, and wherein a most significant bit of an nth feedback bitmask of the plurality of feedback bit masks is set to logic 1 and an(n+1)th feedback bit mask is derived from the nth feedback bit mask andanother of the plurality of feedback bit masks.
 16. A non-transitorycomputer-readable medium containing non-transitory instructions forgenerating a code sequence according to a method comprising: populatinga memory with a sequence of bits; performing a feedback logic operationon bits of the sequence in the memory; performing an output logicoperation on bits of the sequence in the memory; and simultaneouslyoutputting a plurality of bits of the code sequence so generated,wherein performing a feedback logic operation comprises implementing aplurality of bit masks which define how the new input bits aregenerated, and wherein a most significant bit of an nth feedback bitmask of the plurality of feedback bit masks is set to logic 1 and an(n+1)th feedback bit mask is derived from the nth feedback bit mask andanother of the plurality of feedback bit masks.